let v = new Vue({
    el:'#main-container',
    data:{
        imgPath:'code.jpg',
        user:{
            remember:false,
        },
    },
    methods:{
        changeImg:function () {
            this.imgPath = 'code.jpg?' + new Date().toLocaleTimeString();
        },
        doLogin:function () {
            axios({
                url:'doLogin',
                data:this.user,
                method:'post'
            }).then(resp => {
                if (resp.data.success){
                    sessionStorage.setItem("loginUser",JSON.stringify(resp.data.obj));
                    location.href = 'toHome';
                } else{
                    layer.msg(resp.data.msg);
                }
            }).catch(error => {
                layer.msg(error.message);
            })
        },

    },
    created:function () {
        
    }
})